<template>
  <div class="flex-box img-list">
      <img 
        :src="`${img.url}?x-oss-process=image/resize,p_50`"
        v-for="(img, imgIndex) in likeData" 
        :key="img.uid"
        @click="imgOpera(imgIndex)"
      >
  </div>
</template>

<script>
export default {
  props: {
    likeData: Array
  },
  data() {
    return {};
  },
  computed: {
    imgList() {
      return this.flexImgData;
    }
  },
  watch: {
    imgList(value) {
      this.$emit('currentRowChanged', value);
    }
  },
  methods: {
    imgOpera(index) {
      this.imgList.forEach(item => {
        item.active = false;
      });
      this.imgList[index].active = true;
    }
  }
};
</script>

<style scoped>
.img-list {
  overflow: hidden;
}
.active {
  border: 3px solid #9a0007;
}
</style>
